﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using RuleCode.Table;

namespace chatblog.login
{
    public partial class findpassword : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                dealrequest();
            }
        }
        private void dealrequest()
        {
            cbarea area;
            area = cbarea.getcurarea();
            Literal_logolink.Text = area.getlogolink();

        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            cbuser u1 = cbuser.Find("cbuserid = '" + TextBox1.Text.Trim().Replace("'","")+"'");
            if (u1.Count>0)
            {
                RuleCode. Util.Sendmail(u1.cbuserid.ToString(),
                    "找回密码",
                    "你在" + this.Request.Url.Host+"的密码是:"+u1.cbpassword.ToString()
                    );
                MessageBox.Show(this.Page, "密码已经发送到你的电子邮箱中,谢谢.");
            } else
            {
                MessageBox.Show(this.Page, "用户邮箱不存在.");
            }
        }
    }
}
